import  React,{Component} from  'react'
import  '../../css/new/top_banner.css'


const data=require("./data.json")
export  default  class Banner extends Component{
    constructor(props){
        super(props)
        var nr=this.props.getmsg()
        this.state={
            banner:data.data[nr].img
        }
    }
    componentWillReceiveProps(nextProps){
        var nr=this.props.getmsg()
        this.setState({
            banner:data.data[nr].img
        })
    }
    render(){
        return (
            <div className='new_banner'
            style={{background:"url("+this.state.banner+") no-repeat"}}
            >
            </div>
        )
    }
}